<script type="text/javascript">
  function down() {
    var e = document.getElementById("a");
    e.innerText = "down";
    e.style.backgroundColor = "red";
  }
</script>
<div id="a" style="width: 500px;height: 500px;" onmousedown="down()"></div>